Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

make button styles consistent #5916

Merged
merged 3 commits into from
Dec 2, 2016
Merged

make button styles consistent #5916

merged 3 commits into from
Dec 2, 2016

Conversation

jkup
Copy link
Contributor

@jkup jkup commented Nov 29, 2016

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Fix #5894, fix #5801, fix #4708

Auditors @bradleyrichter @bsclifton

Test Plan:

This commit changes a lot of our global button styles. The best way to test this would be to click through each of the settings pages and the corresponding dialogs and make sure the orange and white buttons we use look consistent.

Some specific examples to check:

  1. Preferences > Security > Manage Autofill Data (the buttons on this page should no longer be bold)
  2. Bookmarks > Edit Bookmark (when hovering on the Remove button the text should no longer turn white)
  3. Preferences > General > Import now... (white button should not have orange text)

Here is a great screenshot @bsclifton put together that shows some inconsistencies. These buttons should all look the same now!

buttons

@jkup
Copy link
Contributor Author

jkup commented Nov 29, 2016

Two things I need to fix right now:

Brave lion in top right looks wrong (I removed a class)
Same thing for view all bookmarks button on add/edit bookmark dialog

@luixxiul
Copy link
Contributor

luixxiul commented Nov 30, 2016

The primaryButton seems to need more padding.
screenshot 2016-11-30 10 12 53

padding: .5rem 1rem; should work nice.
screenshot 2016-11-30 10 13 56

Another example
screenshot 2016-11-30 10 18 25

@luixxiul
Copy link
Contributor

luixxiul commented Nov 30, 2016

Also noScript button and buttons inside the noscript dialog should be fixed.

with border: none; background: none; on .browserButton

@luixxiul
Copy link
Contributor

luixxiul commented Nov 30, 2016

Ah, I think I've done too much here :-(

Maybe this PR could be changed to fix all of the button issues (actual/potential) as well as the styling, if you don't mind.

@luixxiul
Copy link
Contributor

.menuButton is yet to be modified, just fyi

line-height: 1.25;
margin: 5px 5px 0px 0px;
padding-top: 5px;
padding-bottom: 5px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1em=16px, 16px*0.3=4.8px≒5px

cursor: pointer;
outline: none;
text-align: left;
// for about:preferences
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The buttons under this section should be removed if necessary. especially from L171 to L176.

@jkup
Copy link
Contributor Author

jkup commented Nov 30, 2016

@luixxiul thanks for those changes!

@luixxiul
Copy link
Contributor

luixxiul commented Dec 1, 2016

Still we should address margin around the buttons because margin-top was removed from the general button class .browserButton. eg. about:autofill

Nevermind, the margin does not exist from the first.

@@ -15,6 +15,7 @@ body {

#paymentsSwitches {
margin-top: 15px;
padding: 5px;
Copy link
Contributor

@luixxiul luixxiul Dec 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The elements become unaligned.

screenshot 2016-12-01 16 56 19

margin-top: 15px;
display: flex;
align-items: center;
min-height: 40px;
Copy link
Contributor

@luixxiul luixxiul Dec 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed into:
screenshot 2016-12-01 17 06 54

The label of the button "off" is slightly up. Will fix with another PR.

padding-left: 1em;
// for about:preferences
.prefBody {
.settingsList > .settingItem + button {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the button should be placed under <SettingCheckbox>. For example: https://github.com/brave/browser-laptop/pull/5916/files#diff-e3eeb751016b2ce9f8278efce585a461R1519

&:hover {
color: white;
}
.settingItem > span + button {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See:

<SettingItem dataL10nId='importBrowserData'>
<Button l10nId='importNow' className='primaryButton importNowButton'
onClick={this.importBrowserDataNow} />
</SettingItem>

&.setAsDefaultButton,
&.manageAdblockSettings,
&.viewExtensionsInfo,
&.manageAutofillDataButton {
Copy link
Contributor

@luixxiul luixxiul Dec 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were replaced with .settingsList > .settingItem + button and .settingItem > span + button. Styling with classes in that way is a cause of inconsistency in both CSS and JS.

font-size: 0.9em;
margin-top: 20px;
padding: 5px 20px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These values should be reconsidered later

@luixxiul
Copy link
Contributor

luixxiul commented Dec 1, 2016

  1. The font-family of the buttons on about:preferences is Arial on common.less, while the global font-family is set to -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; on window.less. This causes another big inconsistency. How should we handle this? @bradleyrichter screenshot 2016-12-01 23 31 33

@bradleyrichter
Copy link
Contributor

bradleyrichter commented Dec 1, 2016 via email

@luixxiul luixxiul changed the title make button styles consistent [WiP] make button styles consistent Dec 1, 2016
jkup and others added 2 commits December 1, 2016 11:24
- some buttons on about:preferences were excluded from settingItem
- the buttons styles on about pages were made consistent
  - about:preferences
  - about:history
- elements in titleBar on about:preferences#payments were aligned
- font-size and padding of the buttons on about:preferences were made consistent

Auditors: @bradleyrichter

Test Plan:
@jkup
Copy link
Contributor Author

jkup commented Dec 1, 2016

@luixxiul Where are we at on this one? I see you opened a lot of issues and added a lot of commits. Is this ready for review / merging in your opinion?

As for changing the font family in common.less, let's split that into another ticket if that's the approach we want to take. As it affects more than just buttons.

@bsclifton
Copy link
Member

Looks good to me! Nice work 😄 I'll leave as-is right now, since it has "WiP" in the title, but if it's all done, let's go ahead and merge it, @jkup 😄

- Paddings of buttons on about:preferences were increased
- Removed unnecessary class

Auditors:

Test Plan:
@@ -158,9 +158,10 @@ span.buttonSeparator {
// for about:preferences
.prefBody {
.settingsList > .settingItem + button,
.settingItem > span + button {
.settingItem > span + button,
#paymentsContainer button:not(.close) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This increases padding except the close "x" button on the payments dialog.

@luixxiul
Copy link
Contributor

luixxiul commented Dec 2, 2016

Increased and added padding of the buttons on about:preferences. I think this is ready for re-review.

@bsclifton
Copy link
Member

Should be good to go 😄 Merging...

@bsclifton bsclifton changed the title [WiP] make button styles consistent make button styles consistent Dec 2, 2016
@bsclifton bsclifton merged commit d3addcf into master Dec 2, 2016
@bsclifton bsclifton deleted the button-styles branch December 2, 2016 21:23
@bradleyrichter
Copy link
Contributor

++, and +

@bradleyrichter
Copy link
Contributor

@jkup @luixxiul I found a spacing issue that might be from this PR. Can you please investigate?

Left is master. Right is 0.12.11
image

@luixxiul
Copy link
Contributor

luixxiul commented Dec 3, 2016

@bradleyrichter I've noticed that and it should be fixed by adding margin-bottom to the wallet address. Will fix.

@bradleyrichter
Copy link
Contributor

thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants